package com.chc.util;

public class ServiceResult<T> {
	public static final int CODE_COMPLETE_SUCCUSS = 101;
	public static final int CODE_COMPLETE_WARN = 201;
	public static final int CODE_NOT_COMPLETE = 301;
	public static final int CODE_NOT_COMPLETE_SESSION_EXPIRED = 302;
	public static final int CODE_EXCEPTION = 401;
	
	//返回CODE,101:服务成功完成;201:服务完成但有警告;301:服务未能完成;401:后端异常
	private int code;
	//属性msg的properties.name
	private String msgCode;
	// 返回信息描述
	private String msg;
	// 返回结果
	private T result;
	//记录数
	private int count;
	
	
	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public ServiceResult(){}
	
	public ServiceResult(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}
	
	public ServiceResult(int code, T result) {
		this.code = code;
		this.setResult(result);
	}
	
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getResult() {
		return result;
	}

	public void setResult(T result) {
		this.result = result;
	}

	public String getMsgCode() {
		return msgCode;
	}

	public void setMsgCode(String msgCode) {
		this.msgCode = msgCode;
	}

}
